<?php

class ObjetoSubject 
{
	private $observers = array();
	private $objeto;
	
	public function setObjeto( Objeto $obj )
	{
		$this->objeto = $obj;
	}
	
	public function getObjeto()
	{
		return $this->objeto;
	}
	
	public function attach( ProcessoObserver $obj )
	{
		$this->observers[] = $obj; 
	}
	
	public function deattach( ProcessoObserver $obj )
	{
		foreach($this->observers as $okey => $oval) 
		{
	        if ($oval == $obj) 
	          unset($this->observers[$okey]);
      	}
		
	}
	
	public function notify()
	{
		foreach( $x as $this->observers )
			$x->update( $this );
	}
}

?>